* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
}

body {
    background-color: #c9f0ff;
    color: #333;
    line-height: 1.6;
    background-image: 
        radial-gradient(#ffffff 8%, transparent 8%), 
        radial-gradient(#ffffff 8%, transparent 8%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    position: relative;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #ff4500;
    font-weight: 700;
    text-shadow: 3px 3px 0 #fff, 4px 4px 0 #000;
    font-size: 2.8rem;
    letter-spacing: 1px;
    animation: rainbow 8s linear infinite, bounce 2s ease-in-out infinite;
    position: relative;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.input-section {
    background-color: #fff8a0;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 0 #e6df72, 0 10px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
    border: 4px solid #000;
    position: relative;
    overflow: hidden;
}

.input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to right, #ff6b6b, #ffb347, #ffd166, #06d6a0, #118ab2, #9b5de5);
    animation: shimmer 3s linear infinite;
    background-size: 600% 100%;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #ff4500;
    font-size: 1.15rem;
    text-shadow: 1px 1px 0 #fff;
}

input, textarea, select {
    width: 100%;
    padding: 14px;
    border: 3px solid #000;
    border-radius: 12px;
    font-size: 1.05rem;
    transition: all 0.3s;
    background-color: #fff;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.15);
}

input:focus, textarea:focus, select:focus {
    border-color: #ff4500;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.3);
}

button {
    background-color: #4cd137;
    color: white;
    border: 4px solid #000;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 6px 0 #2e8617, 0 8px 10px rgba(0,0,0,0.2);
    text-shadow: 2px 2px 0 #000;
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255,255,255,0.3), rgba(255,255,255,0));
    transform: translateY(-100%);
    transition: transform 0.3s;
}

button:hover::after {
    transform: translateY(0);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 #2e8617, 0 12px 15px rgba(0,0,0,0.25);
}

button:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #2e8617, 0 5px 5px rgba(0,0,0,0.2);
}

#save-btn {
    background-color: #ffc107;
    box-shadow: 0 4px 0 #c79100, 0 5px 5px rgba(0,0,0,0.2);
}

#save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #c79100, 0 7px 7px rgba(0,0,0,0.2);
}

#save-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c79100, 0 3px 3px rgba(0,0,0,0.2);
}

#random-btn {
    background-color: #ff8a51;
    box-shadow: 0 4px 0 #d46e34, 0 5px 5px rgba(0,0,0,0.2);
}

#random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #d46e34, 0 7px 7px rgba(0,0,0,0.2);
}

#random-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #d46e34, 0 3px 3px rgba(0,0,0,0.2);
}

#new-character-btn {
    margin-top: 20px;
    background-color: #4dc3ff;
    box-shadow: 0 4px 0 #3a94c5, 0 5px 5px rgba(0,0,0,0.2);
}

#new-character-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #3a94c5, 0 7px 7px rgba(0,0,0,0.2);
}

#new-character-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #3a94c5, 0 3px 3px rgba(0,0,0,0.2);
}

.result-section {
    background-color: #fff8a0;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 0 #e6df72, 0 10px 15px rgba(0, 0, 0, 0.3);
    border: 4px solid #000;
    position: relative;
    overflow: hidden;
}

.result-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to right, #ff6b6b, #ffb347, #ffd166, #06d6a0, #118ab2, #9b5de5);
    animation: shimmer 3s linear infinite;
    background-size: 600% 100%;
}

.character-card {
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
}

.character-info {
    flex: 1;
    width: 100%;
}

.character-info h2 {
    margin-bottom: 20px;
    color: #ff4500;
    text-shadow: 2px 2px 0 #fff, 3px 3px 0 #000;
    font-size: 2rem;
    border-bottom: 4px solid #000;
    padding-bottom: 8px;
    position: relative;
}

.character-info h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #ff6b6b, #ffb347, #ffd166, #06d6a0, #118ab2, #9b5de5);
}

.character-description {
    line-height: 1.7;
}

.section-appearance, .section-personality, .section-backstory, .section-relationships {
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.section-appearance h3, .section-personality h3, .section-backstory h3, .section-relationships h3 {
    color: #ff4500;
    margin-bottom: 8px;
    font-size: 1.3rem;
    text-shadow: 1px 1px 0 #fff;
    background-color: #ffee99;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    border: 3px solid #000;
    box-shadow: 2px 2px 0 #000;
}

.character-meta {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px dashed #000;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.character-role, .character-show {
    background-color: #ffee99;
    padding: 8px 15px;
    border-radius: 10px;
    border: 3px solid #000;
    font-weight: 700;
    display: inline-block;
    box-shadow: 3px 3px 0 #000;
    position: relative;
    overflow: hidden;
}

.toggle-container {
    display: flex;
    align-items: center;
    background-color: #f9f9c0;
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid #000;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-right: 15px;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ff9191;
    transition: .4s;
    border-radius: 30px;
    border: 2px solid #000;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    border: 2px solid #000;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

input:checked + .toggle-slider {
    background-color: #7bed9f;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.color-option {
    display: flex;
    align-items: center;
    margin: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.05);
}

.color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 12px;
    border: 3px solid #000;
    transition: all 0.3s;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.2);
}

.color-swatch.selected {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(255, 69, 0, 0.5), 0 0 10px rgba(255, 69, 0, 0.3);
}

.color-picker {
    display: flex;
    flex-wrap: wrap;
    margin-top: 15px;
    justify-content: center;
    background-color: #f9f9c0;
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #000;
}

.character-extra-info {
    margin-top: 25px;
    padding: 15px;
    background-color: #ffee99;
    border-radius: 12px;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
}

.character-voice, .character-catchphrase, .character-alliance, .character-accessories {
    margin-bottom: 8px;
    padding: 5px;
    background-color: #fffbd8;
    border-radius: 6px;
    border: 1px solid #d1d16e;
}

.character-catchphrase {
    font-style: italic;
}

#accessories, #voice-type, #alliance {
    background-color: #fff;
    cursor: pointer;
}

#custom-accessories-field {
    margin-top: 10px;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.button-row button {
    flex: 1;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(201, 240, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 70px;
    height: 70px;
    animation: rotate 2s linear infinite;
}

.path {
    stroke: #ff4500;
    stroke-linecap: round;
    stroke-width: 6;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.hidden {
    display: none;
}

.skeleton-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-text p {
    height: 15px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes rainbow {
    0% { color: #ff0000; }
    14% { color: #ff7f00; }
    28% { color: #ffff00; }
    42% { color: #00ff00; }
    57% { color: #0000ff; }
    71% { color: #4b0082; }
    85% { color: #9400d3; }
    100% { color: #ff0000; }
}

#custom-color-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

#custom-color {
    width: 50px;
    padding: 5px;
    height: 40px;
    margin-right: 10px;
}

.color-preview {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    border: 2px solid #000;
    vertical-align: middle;
}

.other-projects-section {
    text-align: center;
    margin-top: 30px;
}

.other-projects-btn {
    display: inline-block;
    background: linear-gradient(45deg, #32cd32, #4cd137);
    color: white;
    border: 4px solid #000;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 6px 0 #2e8617, 0 8px 10px rgba(0,0,0,0.2);
    text-shadow: 2px 2px 0 #000;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.text-preview {
    width: 100%;
    padding: 15px;
    background-color: #fffbd8;
    border-radius: 12px;
    text-align: center;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
}

.text-description {
    width: 100%;
    padding: 15px;
    background-color: #fffbd8;
    border-radius: 12px;
    text-align: center;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
}

.description-header {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
}

.description-details {
    text-align: left;
    padding: 10px;
    background-color: #ffee99;
    border-radius: 8px;
    border: 2px solid #000;
}

.description-type {
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1.5;
}

.text-preview pre {
    font-family: monospace;
    white-space: pre;
    margin: 0;
    background-color: #ffee99;
    padding: 15px;
    border-radius: 8px;
    display: inline-block;
    border: 2px solid #000;
}

.text-preview-details {
    margin-top: 15px;
    text-align: left;
    padding: 10px;
    background-color: #ffee99;
    border-radius: 8px;
    border: 2px solid #000;
}

.preview-object-type, .preview-accessories {
    font-weight: bold;
    margin-bottom: 5px;
}

.image-upload-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.upload-btn {
    background-color: #9b59b6;
    box-shadow: 0 4px 0 #7d3c98, 0 5px 5px rgba(0,0,0,0.2);
    min-width: 120px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #7d3c98, 0 7px 7px rgba(0,0,0,0.2);
}

.upload-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #7d3c98, 0 3px 3px rgba(0,0,0,0.2);
}

.remove-btn {
    background-color: #e74c3c;
    box-shadow: 0 4px 0 #c0392b, 0 5px 5px rgba(0,0,0,0.2);
    min-width: 120px;
}

.remove-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #c0392b, 0 7px 7px rgba(0,0,0,0.2);
}

.remove-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c0392b, 0 3px 3px rgba(0,0,0,0.2);
}

.uploaded-image-preview {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9c0;
    border-radius: 10px;
    border: 2px solid #000;
    text-align: center;
}

.uploaded-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
}

.help-text {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}